package com.kqb.sgadmin.service.pipeline.create.handler;

import com.kqb.sgadmin.service.pipeline.create.AdminCreateHandler;
import com.kqb.sgadmin.service.pipeline.create.context.AdminCreateContext;
import com.kqb.sgadmin.utils.PwdUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author 杉果树皮
 */
@Component
@Order(20)
public class PwdHandler implements AdminCreateHandler {
    @Override
    public void handle(AdminCreateContext context) {
        context.setPassword(PwdUtils.bcryptPasswordEncoder(context.getPassword()));
    }
}
